package org.scc.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.scc.model.MeetingPlan;

public class MeetingPlanDao extends BaseDao {

	@Override
	protected String getMapper(String methodName) {
		return "org.scc.sqlmap.MeetingPlanMapper." + methodName;
	}

	public List<Integer> getMeetingPlans(String date, int type, int meetingPlaceId){
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("date", date);
		param.put("type", type);
		param.put("meetingPlaceId", meetingPlaceId);
		
		return selectList(getMapper("getMeetingPlan"), param, "find meetingPlan error");
	}
	
	public void deletePlan(String date, int type, int meetingPlaceId){
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("date", date);
		param.put("type", type);
		param.put("meetingPlaceId", meetingPlaceId);
		delete(getMapper("deletePlan"), param, "delete plan error");
	}
	
	public void add(MeetingPlan meetingPlan){
		insert(getMapper("add"), meetingPlan, "add meeting plan error");
	}
	
}
